<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>花间村 - 我的</title>
    <link rel="stylesheet" href="{{ asset('css/wechat_service_account.css') }}">
    <style>
        .default-address-card {
            background: #fff;
            border-radius: 12px;
            padding: 15px;
            margin: 15px 0;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }
        .address-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .address-title {
            font-size: 16px;
            font-weight: 500;
        }
        .default-tag {
            background: #07C160;
            color: white;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 12px;
        }
        .address-info {
            font-size: 14px;
            color: #333;
            margin-bottom: 5px;
        }
        .address-detail {
            font-size: 13px;
            color: #666;
        }
        .menu-item {
            background: #fff;
            padding: 15px;
            margin-bottom: 1px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 载入用户信息卡 -->
        @include('wechat.service_account.components.user_card')

        <!-- 默认收货地址 -->
        @if(isset($defaultAddress) && $defaultAddress)
        <div class="default-address-card">
            <div class="address-header">
                <div class="address-title">默认收货地址</div>
                <span class="default-tag">默认</span>
            </div>
            <div class="address-info">{{ $defaultAddress->consignee }} {{ $defaultAddress->mobile }}</div>
            <div class="address-detail">{{ $defaultAddress->province }}{{ $defaultAddress->city }}{{ $defaultAddress->district }} {{ $defaultAddress->address }}</div>
        </div>
        @endif

        <a href="{{ route('wechat.service.account.orders.list') }}" style="color:inherit;text-decoration:none;display:block;">
            <div class="menu-item">
                <span>我的订单</span>
                <span>></span>
            </div>
        </a>
        <div class="menu-item">
            <a href="{{ route('wechat.service.account.addresses') }}" style="color:inherit;text-decoration:none;display:flex;flex:1;justify-content:space-between;align-items:center;">
                <span>收货地址</span>
                <span>></span>
            </a>
        </div>
        <a href="{{ route('wechat.service.account.wallet') }}" style="color:inherit;text-decoration:none;display:block;">
            <div class="menu-item">
                <span>我的卡包</span>
                <span>></span>
            </div>
        </a>
        <a href="{{ route('wechat.service.account.redeem') }}" style="color:inherit;text-decoration:none;display:block;">
            <div class="menu-item">
                <span>兑换</span>
                <span>></span>
            </div>
        </a>

        @if(Auth::guard('wechat')->check())
        <form method="POST" action="{{ route('wechat.service.account.logout') }}" style="margin-top:20px;text-align:center;">
            @csrf
            <button type="submit" style="background:#fff;color:#e53e3e;border:1px solid #e53e3e;border-radius:25px;padding:10px 40px;font-size:16px;cursor:pointer;">
                退出登录
            </button>
        </form>
        @endif
    </div>

    <!-- 载入底部导航栏 -->
    @include('wechat.service_account.components.bottom_nav')
</body>

</html>